package com.baogu.factoryjob.job.handler;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.springframework.stereotype.Service;

@Service @DisallowConcurrentExecution
public class ScheduledJob implements Job {
    private Logger logger = LogManager.getLogger(getClass());
    @Override
    public void execute(JobExecutionContext jobExecutionContext) {
        logger.info("这是第一个任务 is running…………………………………… ");
        long time = 30000L;
        try {
            Thread.sleep(time);
            logger.info("这是第一个任务 is end…………………………………… ");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
